package com.lingshu.app.utils;

import java.io.File;

/**
 * @author 于定金
 * @version 1.0
 * @Date 2024/4/9 13:07
 * @Description
 */
public class PathUtils {
    public static String getExtension(String filePath) {
        int index = filePath.lastIndexOf(".");
        String extension = filePath.substring(index);
        return extension;
    }

    public static void checkDirectory(String filePath) {
        File file = new File(filePath);
        File directory = new File(file.getParent());
        if (!directory.exists()) {
            directory.mkdirs();
        }
    }
}
